<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://com.yhm.pagination/pager" prefix="p"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分页测试</title>
<link href="${pageContext.request.contextPath}/css/page.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.7.2.js"></script>
</head>
<body>
<pre>
  <b>
  	form的method="get" 所有参数都以get方式提交，此时中文会出现问题.一般在没有中文参数时使用
  	传递get参数：user.name,user.code,user.sex,user.description,pageUtil.currentPage,pageUtil.pageSize
  </b>
</pre>
	<form action="${pageContext.request.contextPath}/findAll02" method="get" id="frmquery1" callback="callback">
		<div>名字：<input type="text" name="user.name" value="${user.name}"><br/>
		             账号：<input type="text" name="user.code" value="${user.code}"><br/>
		            性别: <select name="user.sex">
		              <option value="0" ${user.sex==0?"selected='selected'":""}>女</option>
		              <option value="1" ${user.sex==1?"selected='selected'":""}>男</option>
		           </select><br/> 
		            说明:<textarea rows="3" cols="16" name="user.description">${user.description}</textarea><br/>
		           		           	                     
		<input type="submit" value="查询"></div>
		
		<table>
			<tr><th>名字</th><th>年龄</th></tr>			
			<c:forEach items="${users}" var="u">
				<tr>
					<td>${u.name}</td>
					<td>${u.sexName}</td>
				</tr>
			</c:forEach>
		</table>
		<div class="badoo" style="text-align: left">
		   <p:pager name="pageUtil" currentPage="${pageUtil.currentPage}" pageSize="${pageUtil.pageSize}" 
		            totalCount="${pageUtil.totalCount}"  pagerForm="frmquery1"/>
		</div>
	</form>
<script type="text/javascript">

function callback(data){
	if(console) console.log("回调");
	location.href="${pageContext.request.contextPath}/findAll02?page=2";
	return false;
}
</script>	
</body>
</html>